﻿using System;
using System.Collections.Generic;

namespace Legend.Web.QueryString
{
    /// <summary>
    /// Handles the serialization and deserialization of query strings.
    /// </summary>
    public interface IQueryStringSerializer
    {
        /// <summary>
        /// Gets a dictionary of key value pairs that's contained
        /// in the specified query string.
        /// </summary>
        /// <param name="queryString">The query string to get values from.</param>
        /// <returns>The parsed query.</returns>
        IDictionary<string, string> Parse(string queryString);

        /// <summary>
        /// Serializes the specified dictionary to a query string.
        /// </summary>
        /// <param name="keyValuePairs">The parameters and values of the query string.</param>
        /// <returns>The serialized query string.</returns>
        string Serialize(IDictionary<string, string> keyValuePairs);
    }
}
